/*
 * @Description:
 * @Author: HYH
 * @LastEditors: HYH
 * @LastEditTime: 2023-06-28 14:22:59
 */
import request from '@/utils/request'

/**自动获取SKU编号 */
export function initSkuNo(data) {
  return request({
    url: '/distribution/skuDistributor/initSkuNo',
    method: 'get',
    data
  })
}

// 获取供应商SKU列表
export function skuDistributorGetDistributorSkuList(query) {
  return request({
    url: '/distribution/skuDistributor/getDistributorSkuList',
    method: 'get',
    params: query
  })
}

// 获取供应商SKU详情
export function skuDistributorSellerApply(data) {
  return request({
    url: '/distribution/skuDistributor/getSkuDistributorDetails',
    method: 'post',
    data
  })
}

/**查询供应商SKU列表-平台角色 */
export function getDistributorSkuListByPlatform(params) {
  return request({
    url: `distribution/skuDistributor/getDistributorSkuListByPlatform`,
    params,
  })
}


// 获取供应商SKU删除
export function deleteDistributorSku(ids) {
  return request({
    url: `/distribution/skuDistributor/deleteDistributorSku?ids=${ids}`,
    method: 'delete',
  })
}


/**开启云操作 */
export function cloudFlag(data) {
  return request({
    url: `/distribution/skuDistributor/cloudFlag`,
    data,
    method: 'post'
  })
}

/**预留规则 */
export function skuDistributorSetRule(data) {
  return request({
    url: `/distribution/skuDistributor/setRule`,
    method: 'post',
    data
  })
}

/**批量设置预留规则 */
export function batchSetRule(data) {
  return request({
    url: `/distribution/skuDistributor/batchSetRule`,
    method: 'post',
    data
  })
}


/**设置价格模式 */
export function skuDistributorSetPriceMode(data) {
  return request({
    url: `/distribution/skuDistributor/setPriceMode`,
    method: 'post',
    data
  })
}

/**批量设置价格模式 */
export function batchSetPriceMode(data) {
  return request({
    url: `/distribution/skuDistributor/batchSetPriceMode`,
    method: 'post',
    data
  })
}




// 获取供应商SKU详情
export function getSkuDistributorDetails(query) {
  return request({
    url: '/distribution/skuDistributor/getSkuDistributorDetails',
    method: 'get',
    params: query
  })
}
/**SKU图片上传 */
export function uploadSkuImg(formData) {
  return request(
    {
      url: `/system/oss/uploadSkuImg`,
      method: 'post',
      data: formData,
      headers: { 'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundary7TMYhSONfkAM2z3a', 'timeout': 20000 },
      repetitiveConfig: {
        neglectful: true,
        interval: 3000
      },
    }
  )

}


/**SKU批量导入上传 */
export function skuDistributorImportAdd(formData) {
  return request(
    {
      url: `/distribution/skuDistributor/importAdd`,
      method: 'post',
      data: formData,
      headers: { 'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundary7TMYhSONfkAM2z3a', 'timeout': 20000 }
    }
  )

}


/**获取供应商sku库存来源 */
export function getStockSource(data) {
  return request({
    url: '/distribution/skuDistributor/getStockSource',
    method: 'post',
    data
  })
}

/**查询sku下所有卖家持有统计 */
export function statisticsSellerStock(params) {
  return request({
    url: '/distribution/skuDistributor/statisticsSellerStock',
    params
  })
}




